package cn.dada.dadarecipes.user.personal_account_record.controller;

import cn.dada.dadarecipes.base.response.JsonResult;
import cn.dada.dadarecipes.user.personal_account.pojo.vo.PersonalAccountVO;
import cn.dada.dadarecipes.user.personal_account_record.pojo.vo.PersonalAccountRecordVO;
import cn.dada.dadarecipes.user.personal_account_record.service.PersonalAccountRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "01.05个人账户记录管理")
@Slf4j
@RestController
@RequestMapping("/v1/user")
public class PersonalAccountRecordController {

    @Autowired
    PersonalAccountRecordService personalAccountRecordService;

    @ApiOperation(value = "查询账户记录")
    @GetMapping("/checkUserPaymentRecords/{id}")
    public JsonResult checkUserPaymentRecords(@PathVariable Long id) {
        log.debug("用户查询:userId={}", id);
        List<PersonalAccountRecordVO> personalAccountRecordVOS = personalAccountRecordService.query(id);
        return JsonResult.ok(personalAccountRecordVOS);
    }

}